﻿<Window x:Class="ImoutoDesktop.Windows.SettingDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:i="clr-namespace:ImoutoDesktop"
    x:Name="window"
    Title="設定" Height="350" Width="550" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" ResizeMode="NoResize"
    Topmost="True" DataContext="{x:Static i:Settings.Default}" Loaded="SettingDialog_Loaded">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    </Window.Resources>
    <Window.BindingGroup>
        <BindingGroup />
    </Window.BindingGroup>
    <Grid Margin="10">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <ListBox Grid.Column="0" Grid.Row="0" Width="140" Margin="0,0,10,0" IsSynchronizedWithCurrentItem="True">
            <ListBox.ItemContainerStyle>
                <Style TargetType="{x:Type ListBoxItem}">
                    <Setter Property="Padding" Value="6,3,0,3"/>
                </Style>
            </ListBox.ItemContainerStyle>
            <ListBoxItem x:Name="generalListBoxItem" IsSelected="True">
                <StackPanel Orientation="Horizontal">
                    <TextBlock>全般</TextBlock>
                </StackPanel>
            </ListBoxItem>
            <ListBoxItem x:Name="networkListBoxItem">
                <StackPanel Orientation="Horizontal">
                    <TextBlock>ネットワーク</TextBlock>
                </StackPanel>
            </ListBoxItem>
            <ListBoxItem x:Name="imoutoListBoxItem">
                <StackPanel Orientation="Horizontal">
                    <TextBlock>いもうと</TextBlock>
                </StackPanel>
            </ListBoxItem>
            <ListBoxItem x:Name="otherListBoxItem">
                <StackPanel Orientation="Horizontal">
                    <TextBlock>その他</TextBlock>
                </StackPanel>
            </ListBoxItem>
        </ListBox>
        <Canvas Grid.Column="1" Grid.Row="0" Visibility="{Binding Path=IsSelected, ElementName=generalListBoxItem, Converter={StaticResource BooleanToVisibilityConverter}}">
        	<TextBlock Height="18" Text="ユーザー名" TextWrapping="Wrap" Canvas.Top="18" Canvas.Left="10"/>
        	<TextBox Text="{Binding Path=UserName, Mode=TwoWay}" TextWrapping="Wrap" Canvas.Top="16" Canvas.Left="104" Width="230"/>
        	<TextBlock Text="敬称" TextWrapping="Wrap" Canvas.Top="60" Canvas.Left="8"/>
            <ComboBox IsSynchronizedWithCurrentItem="True" Canvas.Top="60" Canvas.Left="104" Width="230" SelectedValuePath="Tag" SelectedValue="{Binding Path=Honorific, Mode=Default}">
                <ComboBoxItem Content="敬称なし" Tag=""/>
                <ComboBoxItem Content="様" Tag="様"/>
                <ComboBoxItem Content="殿" Tag="殿"/>
                <ComboBoxItem Content="さん" Tag="さん"/>
                <ComboBoxItem Content="ちゃん" Tag="ちゃん"/>
                <ComboBoxItem Content="君" Tag="君"/>
                <ComboBoxItem Content="きゅん" Tag="きゅん"/>
                <ComboBoxItem Content="たん" Tag="たん"/>
                <ComboBoxItem Content="タン" Tag="タン"/>
                <ComboBoxItem Content="タソ" Tag="タソ"/>
            </ComboBox>
        </Canvas>
        <Canvas Grid.Column="1" Grid.Row="0" Visibility="{Binding Path=IsSelected, ElementName=networkListBoxItem, Converter={StaticResource BooleanToVisibilityConverter}}">
				<TextBlock Text="サーバアドレス" Canvas.Left="10" Canvas.Top="18"/>
				<TextBlock Text="ポート番号" Canvas.Left="10" Canvas.Top="54"/>
				<TextBlock Text="接続パスワード" Canvas.Left="10" Canvas.Top="89"/>
				<TextBox Width="230" Canvas.Left="104" Canvas.Top="16" Text="{Binding Path=ServerAddress, Mode=TwoWay}"/>
				<TextBox Width="230" Canvas.Left="105" Canvas.Top="51" Text="{Binding Path=PortNumber, Mode=TwoWay}"/>
				<PasswordBox Width="230" Canvas.Left="105" Canvas.Top="86" x:Name="password" FontFamily="{DynamicResource {x:Static SystemFonts.MessageFontFamilyKey}}"/>
        </Canvas>
        <Canvas Grid.Column="1" Grid.Row="0" Visibility="{Binding Path=IsSelected, ElementName=imoutoListBoxItem, Converter={StaticResource BooleanToVisibilityConverter}}">
            <TextBlock Text="ツンツン" TextWrapping="Wrap" Canvas.Left="20" Canvas.Top="63"/>
            <TextBlock Text="デレデレ" TextWrapping="Wrap" Canvas.Right="8" Canvas.Top="63" Canvas.Left="302"/>
            <Slider Width="290" Canvas.Left="40" Canvas.Top="92" TickPlacement="BottomRight" SmallChange="1" Minimum="1" Maximum="9" IsSnapToTickEnabled="True" Value="{Binding Path=TsundereLevel, Mode=TwoWay, ElementName=window}"/>
            <TextBlock Text="年齢" TextWrapping="Wrap" Canvas.Left="10" Canvas.Top="18"/>
            <TextBox Canvas.Top="16" Canvas.Left="104" Width="137" Text="{Binding Path=Age, Mode=TwoWay, ElementName=window}"/>
            <TextBlock Text="歳" TextWrapping="Wrap" Canvas.Top="18" Canvas.Left="246"/>
        </Canvas>
        <Canvas Grid.Column="1" Grid.Row="0" Visibility="{Binding Path=IsSelected, ElementName=otherListBoxItem, Converter={StaticResource BooleanToVisibilityConverter}}">
            <CheckBox Canvas.Left="10" Canvas.Top="16" IsChecked="{Binding Path=ShowFileList, Mode=TwoWay}">ディレクトリ移動時に中身を表示する</CheckBox>
        </Canvas>
        <StackPanel Grid.ColumnSpan="2" Grid.Row="1" Margin="0,10,0,0" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Width="100" IsDefault="True" Click="OkButton_Click">OK</Button>
            <Button Width="100" IsCancel="True" Margin="5,0,0,0" Click="CancelButton_Click">キャンセル</Button>
        </StackPanel>
    </Grid>
</Window>
